#ifndef __MYSTDIO_H__
#define __MYSTDIO_H__ 

#define SIZE 4096
#define UMASK 0666

#define FLUSH_NONE 1
#define FLUSH_LINE 2
#define FLUSH_FULL 4

#define NORMAL 1
#define FORCE 2

typedef struct _MY_IO_FILE
{
    int fileno;
    int flag;
    char outbuffer[SIZE];
    int curr;
    int cap;
} MyFILE;

MyFILE* my_fopen(const char* filename, const char* mode);
void my_fclose(MyFILE* pf);
int my_fwrite(const char* s, int size, MyFILE* pf);
void my_fflush(MyFILE* pf);

#endif
